package com.iRomantic.domain.entity;

import java.sql.Timestamp;
import java.util.List;
import java.util.UUID;

import com.jfinal.plugin.activerecord.Model;

/**
 * 客户表
 */
public class Client extends Model<Client>{
	
	public static final Client DAO=new Client();

	public boolean save()
	{
		Timestamp currTime = new Timestamp(System.currentTimeMillis());
		if(this.getStr("id")!=null){
			this.set("id", UUID.randomUUID().toString());
		}
		
		return super.save();
		
	}
	
	public boolean update()
	{
	 	return super.update();
	}
	
	/**
	 * 查看该客户的APP
	 */
	public List<Wedding> getApps()
	{
		return Wedding.DAO.find("select *from t_wedding where T_C_id=? ", this.get("id"));
		
	}

}
